﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TaskContainerControl.ascx.cs" Inherits="SimplePMT.Control.TaskContainerControl" %>
<form name="containerForm" id="containerForm">
<input type="hidden" name="TaskContainerID" value="<%= taskContainer.ID %>" />
<input type="hidden" name="ParentTaskContainerID" value="<%= parentTaskContainerID %>" />

<table width="100%" cellpadding=3>
        <tr>
            <td width="90%" style="white-space:nowrap;color:#ffffff" bgcolor="#869AAE"><b>Task Container: <%= title %></b></td>
        </tr>
        <tr>
            <td style="border:1px solid #6893cf;" valign=top>
                <div id="TaskView">
                <table width="96%" align=center>
                    <tr>
                        <td align=right><b>Label:</b></td>
                        <td><%= FormElement.TextBox(80, "Label", taskContainerLabel, "", edit) %></td>
                    </tr>
                    <tr>
                        <td align=right valign=top><b>Description:</b></td>
                        <td><%= FormElement.TextArea(81, 10, "Description", taskContainer.Description, "", edit) %></td>
                    </tr>
                    <tr>
                        <td align=right><b>Visible:</b></td>
                        <td style="white-space:nowrap;"><%= FormElement.CheckBox("IncludeInProjectPlan", "Yes|No", "", "", edit, taskContainer.IncludeInProjectPlan) %> (include in project reporting) <% if (edit) { %><span style="width:75%;text-align=center"><% if (taskContainer.ID > 0) { %><button type="button" onclick="confirmDelete(<%= taskContainer.ID %>, <%= parentTaskContainerID %>);">Delete</button>&nbsp;&nbsp;&nbsp;<% } %><button type="button" onclick="cancel();">Cancel</button>&nbsp;&nbsp;&nbsp;<button type="button" onclick="saveTaskContainer(<%= taskContainer.ID %>, <%= parentTaskContainerID %>, document.containerForm.Label.value, document.containerForm.Description.value, <%= Session["MemberID"] %>, document.containerForm.IncludeInProjectPlan.checked);">Save Changes</button></span><% } %></td>
                    </tr>
                </table>
                
                </div>
            </td>
        </tr>
    </table>
    <p>
    
<% if (taskContainer.ID > 0) { %>
    <table width="100%" cellpadding=3>
        <tr>
            <td width="90%" style="white-space:nowrap;color:#ffffff" bgcolor="#869AAE" onmouseover="this.style.cursor='pointer';" onclick="showHideMoveOptions();"><img name="moveOptionsImage" src="images/closed.gif" /> <b>Move Task Options</b></td>
        </tr>
        <tr>
            <td style="border:1px solid #6893cf;" valign=top>
                <table width="96%" align=center style="display:none" id="moveOptionsContainer">
                    <tr>
                        <td align=right bgcolor="#CACACA"><% if (!moveBuffer)
                                                             { %>Select All <input type="checkbox" onclick="selectAll(this);" /><% } %></td>
                        <td>
                        <% if (moveBuffer)
                           { %>
                        <button type="button" onclick="clearTaskBuffer();">Clear Move Buffer</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <button type="button" onclick="completeMove();">Move Tasks Here</button>&nbsp;&nbsp;&nbsp;
                        <% }
                           else
                           { %>
                        <button type="button" onclick="moveSelected();">Move Selected Tasks</button>
                        <% } %>
                        </td>
                    </tr>
                    <% foreach (Task task in tasks)
                       { %>
                    <tr>
                        <td align=right><% if (!moveBuffer)
                                           { %><input type="checkbox" name="task<%= task.ID %>" value="<%= task.ID %>" /><% } %></td>
                        <td><%= task.Title%></td>
                    </tr>
                    <% } %>
                </table>
            </td>
        </tr>
    </table>
    <% } %>
    
    </p>
    </form>
    <script>
    <%= jsArray %>
    </script>